package com.linb.pan.server.modules.file.po;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.linb.pan.web.serializer.IdEncryptSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel(value = "文件树响应体")
public class FolderTreeNodeVO implements Serializable {

    private static final long serialVersionUID = -4137449659982759891L;

    @ApiModelProperty(value = "文件id")
    @JsonSerialize(using = IdEncryptSerializer.class)
    private Long id;

    @ApiModelProperty(value = "文件夹名称")
    private String label;

    @JsonSerialize(using = IdEncryptSerializer.class)
    @ApiModelProperty(value = "父文件id")
    private Long parentId;

    @ApiModelProperty(value = "子节点集合")
    private List<FolderTreeNodeVO> children;

    public void print() {
        String folderTree = JSON.toJSONString(this);
        System.out.println(folderTree);
    }

}
